package cn.itcast.config;

import cn.itcast.properties.MinioProperties;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

/**
 * MinIo的配置类
 *
 */
@Configuration
public class MinIOConfig {

    @Autowired
    private MinioProperties minioProperties;

    public MinioClient buildMinioClient(){
        return MinioClient.builder()
                .credentials(minioProperties.getAccessKey(),minioProperties.getSecretKey())
                .endpoint(minioProperties.getEndpoint())
                .build();
    }
}
